﻿<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
        <Header>
            <Title>Define a new view model class</Title>
            <Shortcut>vm</Shortcut>
            <Description>Code snippet for a new view model class</Description>
            <Author>CatenaLogic</Author>
            <SnippetTypes>
                <SnippetType>Expansion</SnippetType>
            </SnippetTypes>
        </Header>
        <Snippet>
            <Declarations>
                <Literal>
                    <ID>name</ID>
                    <ToolTip>Name of the view model</ToolTip>
                    <Default>name</Default>
                </Literal>
            </Declarations>
            <Code Language="csharp">
                <![CDATA[public class $name$ViewModel : ViewModelBase
{
    public $name$ViewModel ()
    {
    }

    public override string Title { get { return "$name"; } }
    
    // TODO: Register properties using 'vmprop'
    // TODO: Register properties that represent models using 'vmpropmodel'
    // TODO: Register properties that map to models using 'vmpropviewmodeltomodel'
    // TODO: Register commands using 'vmcommand', 'vmcommandwithcanexecute', 'vmtaskcommand' or 'vmtaskcommandwithcanexecute'
    
    protected override async Task InitializeAsync()
    {
        await base.InitializeAsync();
        
        // TODO: Add initialization logic like subscribing to events
    }
    
    protected override async Task CloseAsync()
    {
        // TODO: Add uninitialization logic like unsubscribing from events
    
        await base.CloseAsync();
    }
}]]>
            </Code>
        </Snippet>
    </CodeSnippet>
</CodeSnippets>
